import { http } from "@/utils/http";
import { baseUrlApi, filerEmptyVal } from "../utils";

/** 商品报废记录列表 */
export const getScrapPage = (params?: object) => {
  return http.request<any>("get", baseUrlApi("/scrap/page"), {
    params: filerEmptyVal(params)
  });
};

/** 添加商品报废记录 */
export const scrapAdd = (data?: object) => {
  return http.request<any>("post", baseUrlApi("/scrap/add"), { data });
};

/** 新增内查询 */
export const getScrapSearch = (params?: object) => {
  return http.request<any>("get", baseUrlApi("/scrap/add/search"), {
    params: filerEmptyVal(params)
  });
};

/** 删除 */
export const scrapDel = data => {
  return http.request<any>("post", baseUrlApi("/scrap/delete?id=" + data.id), {
    data
  });
};
